import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/page',
    name: 'page',
    component: () => import('../views/page/index.vue'),
    children: [
      {
        path: '/page/userlist',
        name: 'userlist',
        component: () => import('../views/page/userlist.vue')
      },
      {
        path: '/page/jurisdiction',
        name: 'jurisdiction',
        component: () => import('../views/page/jurisdiction.vue')
      },
      {
        path: '/page/commodity',
        name: 'commodity',
        component: () => import('../views/page/commodity.vue')
      },
      {
        path: '/page/order',
        name: 'order',
        component: () => import('../views/page/order.vue')
      },
      {
        path: '/page/data',
        name: 'data',
        component: () => import('../views/page/data.vue')
      },
    ]
  },
  {
    path:"/",
    redirect:"/login"
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue')
  }
]

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
})

export default router
